package com.tcm.springcloud.dubbo.consumer;

import com.tcm.springcloud.dubbo.api.OrderService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
@SpringBootApplication
public class DubboConsumerApplication {

    public static void main(String[] args) {

        SpringApplication.run(DubboConsumerApplication.class);

    }

    @Reference
    OrderService orderService;

    @GetMapping("/getOrder/{orderNo}")
    public String getOrder(@PathVariable int orderNo){
        return orderService.getOrder(orderNo);
    }

}
